<script>
export default {
  name: 'DrawerStyle',
  props: {
    textAlign: {
      type: String,
      default: 'left'
    }
  }
}
</script>

<template>
  <el-drawer v-bind="$attrs" :append-to-body="true" v-on="$listeners">
    <div v-if="$slots.footer" class="el-drawer-style__content">
      <div class="el-drawer-style__body">
        <slot />
      </div>
      <div class="el-drawer-style__footer" :style="{textAlign: textAlign || 'right'}">
        <slot name="footer" />
      </div>
    </div>
    <div v-else class="el-drawer-style__content">
      <slot />
    </div>
  </el-drawer>
</template>

<style scoped lang="scss">
::v-deep .el-drawer__header{
  margin-bottom: 15px;
  font-size: 14px;
  color: #333;
  padding-top: 15px!important;
  font-weight: 600;
}

::v-deep .el-drawer__body{
  border-top: 1px solid #e8e8e8;
}

.el-drawer-style__content{
  height: calc(100%);
  width: 100%;
  position: relative;

  .el-drawer-style__body{
    height:  calc(100% - 60px);
    width: 100%;
    position: relative;
    background: #bfcbd9;
  }
}

.el-drawer-style__footer{
  height: 60px;
  width: 100%;
  line-height: 60px;
  background: white;
  border-top: 1px solid #e8e8e8;
  padding: 0 10px;
}

::v-deep .el-drawer{
  border-left: 1px solid #e8e8e8!important;
}
</style>
